%{
#include <stdio.h>
#include <string.h>
#include "push.h"
extern FILE * yyin;

#define Print(Type,Star,Name) printf("@property (nonatomic, retain) %s %s%s;\n@synthesize %s;\n",Type,Star,Name,Name);

%}


%union
 {
  int number;
  char *string;
 }

%token <string> WORD
%token DOT SEMICOLON
%token COMMA LT GT

%%

All:
| All expressions
;

expressions:
|WORD Type WORD SEMICOLON {push($3);PrintStatement();}
;

Type:
WORD {push($1);}
|Type DOT WORD {push($3);}
|WORD LT Paras GT {push($1);}
;

Paras:
WORD
|
WORD COMMA WORD
;
%%

int yywrap()
{

  return 1;
}

int main(void) {
  int yydebug = 1;
  //  freopen("D:\\workspace\\out.txt","w",stdout); 
  yyin = fopen("D:\\workspace\\test.txt","r");
/*   yyin = fopen("test.txt","r");  */
  yyparse();
  
  fclose(yyin);
  //  fclose(stdout);  
  return 0;
}
